﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace NetworkDemo
{
    public enum Layer
    {
        Background = 0,
        Ground = 10,
        Mob = 20,
        Obj = 30,
        Fly = 40,
        Hud = 99
    }

    public class Sprite
    {
        #region Properties
        private Layer layer;
        public Layer Layer
        {
            get { return layer; }
            set { layer = value; }
        }
        private Texture2D texture;
        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }

        private Vector2 position;
        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }

        private Vector2 scale;
        public Vector2 Scale
        {
            get { return scale; }
            set { scale = value; }
        }

        private Vector2 origin;
        public Vector2 Origin
        {
            get { return origin; }
            set { origin = value; }
        }
        #endregion
        public Sprite(Texture2D tex, Vector2 pos, Vector2 scale, Vector2 origin, Layer layer)
        {
            Texture = tex;
            Position = pos;
            Scale = scale;
            Origin = origin;
            Layer = layer;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Texture, Position, null, Color.White, 0.0f, Origin, Scale, SpriteEffects.None, (float)Layer / 100.0f);
        }

    }
}
